/*
 * This file is a part of the SWFer project.
 *
 * Copyright (C) 2012 Michael Bradshaw <mjbshaw@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef TAGS_HPP
#define TAGS_HPP

#include "TagCodes.hpp"

namespace swfer
{

template <TagCode code>
struct Tag;

// TODO: include the header? Or not?
template <>
struct Tag<END>
{
};

template <>
struct Tag<DEFINE_SOUND>
{
	uint16_t id;
	BitField<4> format;
	BitField<2> rate;
	BitField<1> size;
	BitField<1> type;
	uint32_t sampleCount;

	union
	{
		struct
		{
			BitField<2> codeSize;
		} adpcm;
		
		struct
		{
			int16_t seekSamples;
		} mp3;
	} record;

	std::vector<char> data;
};

template <>
struct Tag<DO_ABC>
{
	uint32_t flags;
	std::string name;

	std::vector<char> data;
};

template <>
struct Tag<SYMBOL_CLASS>
{
	//uint16_t numSymbols; // I'll use symbols.size();

	struct Symbol
	{
		uint16_t tag;
		std::string name;
	};

	std::vector<Symbol> symbols;
};

}

#include "EndTag.hpp"

#endif
